/**
 * 
 */
package com.es.business;

import org.apache.log4j.Logger;
import org.omg.CORBA.portable.IndirectionException;

import com.es.dao.SalesWorkForceDAO;
import com.es.dao.factory.DAOFactory;
import com.es.exception.business.ESAuthenticationException;
import com.es.model.SalesWorkForce;

/**
 * @author Bushra Nazir
 *
 */
public class LoginManagementImpl implements ILoginManagement{
	
	private static final Logger log = Logger.getLogger(LoginManagementImpl.class);
	private SalesWorkForceDAO salesWorkForceDAO = (SalesWorkForceDAO)DAOFactory.getDataAccessObject(DAOFactory.SALESWORKFORCE_DAO);
 
	
	public SalesWorkForce login(String code, String password) throws ESAuthenticationException {
	
		log.info(" inside LoginManagementImpl's login() ");
		
		SalesWorkForce	salesWorkForce = null;
		
		try {
			
			salesWorkForce = salesWorkForceDAO.getUserByUserCodeAndPassword(code, password);
			log.info(salesWorkForce.getFirstname());
			
			
		}catch (Exception e) {
			// TODO: handle exception
		}
	
		
		
		return salesWorkForce;
	}

	
	

}
